package com.ashen.boot.admin.configuration.datafilter;

import lombok.Data;

import java.util.Set;

@Data
public class CkFilterMetaData {
    public final String ckdm;
    public final Set<String> ckdms;
    public final CkFilterTypeEnum filterType;
    public final String sql;

    private CkFilterMetaData(CkFilterMetaData.Builder builder) {
        this.ckdm = builder.ckdm;
        this.ckdms = builder.ckdms;
        this.filterType = builder.filterType;
        this.sql = builder.sql;
    }

    public static Builder builder() {
        return new Builder();
    }


    public static class Builder {
        //必须参数
        private CkFilterTypeEnum filterType;

        // 可选参数
        private String ckdm;
        private Set<String> ckdms;
        private String sql;


        public Builder() {
        }

        //使用设置好的参数值新建 OperateLog 对象
        public CkFilterMetaData build(){
            return new CkFilterMetaData(this);
        }


        public CkFilterMetaData.Builder ckdm(String  ckdm) {
            this.ckdm = ckdm;
            return this;
        }

        public CkFilterMetaData.Builder ckdms(Set<String> ckdms) {
            this.ckdms = ckdms;
            return this;
        }

        public CkFilterMetaData.Builder filterType(CkFilterTypeEnum filterType) {
            this.filterType = filterType;
            return this;
        }

    }

}
